<template>
	<view class="page">
		<view class="tit">{{detail.title}}</view>
		<view class="date">{{detail.time}}</view>
		<jyf-parser class="content" :html="detail.context" ref="article"></jyf-parser>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detail: {}
			};
		},
		onLoad(opt) {
			this.id = opt && opt.id
			this.getDetail(this.id)
		},
		methods: {
			getDetail(id) {
				this.$http.get(this.$api.getAnnounceDetail, {id}).then(res => {
					if (res.code == 200) {
						this.detail = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.page {
	padding: 30rpx;
	min-height: 100vh;
	background-color: #fff;
	
	.tit {
		font-size: 28rpx;
		font-weight: 500;
		margin-bottom: 20rpx;
		text-align: center;
	}
	.date {
		font-size: 24rpx;
		color: #999;
		text-align: center;
		margin-bottom: 37rpx;
	}
	.content {
		font-size: 26rpx;
		color: #666;
		line-height: 40rpx;
	}
}
</style>
